Helpful Information
 
 
Category: vBulletin 3 Articles
Use <?php, not <?

I was reading through the PHP5 readme (which is basically the same as PHP4's), and there's a comment stating that you should always use <?php instead of <? when opening a PHP block. The reason is that the shorthand <? can be disabled; although it isn't by default, you should always develop your code with that in mind.

(of course I have to, now, also :p)

Also <? is ASP but it is acceptable ;)

- miSt

Can't you even use <% in PHP? I've never tried, but I think I've read that somewhere...

Today at 05:45 PM N!ck said this in Post #3 (http://www.vbulletin.org/forum/showthread.php?postid=416469#post416469)
Can't you even use <% in PHP? I've never tried, but I think I've read that somewhere...

Not to my knowledge. The only tags I know for PHP are;
<?php, <? and <script language="php">

On no i got confused again. <% is asp but can work in php but its not recommended as its not supported by all coding environments. I need to read my book again. I'll be back with info :)

- miSt

Today at 12:45 PM N!ck said this in Post #3 (http://www.vbulletin.org/forum/showthread.php?postid=416469#post416469)
Can't you even use <% in PHP? I've never tried, but I think I've read that somewhere...

You can if you enable it in php.ini. I don't know why you'd want to, though; it's harder to type <% than <? (in the latter the two keys are right next to each other).

Yeo you can use <% but the ? sign is so much easier ;)

See? I was right, Steve... :D I don't use <% and haven't seen it used, but I just knew I'd read that somewhere...

Yep you definately can use <% :)

- miSt










privacy (GDPR)